<?php


class Framework_DB_Table_MsgCategory extends Framework_DB_Table_Common {

	public $tableName = 'MsgCategory';
	public function __construct($db) {
   		
   		// Columns
   		$this->col = array(
	   		// Primary Key
	        'idMsgCategory'  => array(
	           'type'     => 'integer',
	           'require'  => true
	        ),
	      
	        'val'   => array(
	           'type'     => 'varchar',
			   'size'     => 255
	        )
	    );
	    
	    
	    $this->auto_inc_col = 'idMsgCategory';
	    
	    // Indexes
	    $this->idx = array(
	    	'idMsgCategory'  =>  'primary'
	    );
   		
	    parent::__construct($db);
   }
   
   // Populate upon creation
   public function create($flag)
   {
   		
   		$result = parent::create($flag);
   	
   		if($result == true){
   			$data = array(
   				array('friends'),
   				array('watching'),
   				array('watchedBy'),
   				array('other')
   			);
   			
   			foreach($data AS $insertItem) {
   				$this->insert(array('val' => $insertItem[0]));
   				
   			}
   			
   		}
   		
   		return $result;
   	
   }
	
	
}

?>